import React from 'react';
import {Avatar} from 'weaver-mobile';

export default {
  template: [{
    key: 'col1',
    render: (data) => {
      const {id, requestParams, lastname, jobtitlename, subcompanyname, departmentname} = data;
      const avatarProps = {userId: id};
      requestParams && Object.assign(avatarProps, {requestParams: JSON.parse(requestParams)});
      return (
        <div style={{display: 'flex'}}>
          <div style={{marginRight: 10}}>
            {/* <Avatar name={data.lastname || ''} url={data.img} /> */}
            <Avatar {...avatarProps} />
          </div>
          <div style={{flex: 1}}>
            <div style={{width: '100%'}}>
              <div style={{width: '50%', float: 'left'}} className='text-elli'>{lastname}</div>
              <div style={{width: '50%'}} className='text-elli'>{jobtitlename}</div>
            </div>
            <div style={{width: '100%'}}>
              <div style={{width: '50%', float: 'left'}} className='text-elli'>{subcompanyname}</div>
              <div style={{width: '50%'}} className='text-elli'>{departmentname}</div>
            </div>
          </div>
        </div>
      );
    },
  }]
};